﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HCFramework.API.LINQ;

namespace HCFramework.Master.Normal
{
    public partial class Normal : System.Web.UI.MasterPage
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                
            }
        }

        private void SetTitle()
        {
            Trang trang = C.TrangController.GetCurrentTrangOrInsert();
            string title = trang.Title + "";
            string meta = trang.Meta + "";
            string des = trang.Description + "";
            foreach (var item in this.Request.QueryString.AllKeys)
            {
                title = title.Replace("{" + item + "}", Request[item]);
                meta = meta.Replace("{" + item + "}", Request[item]);
                des = des.Replace("{" + item + "}", Request[item]);
            }
            this.Page.Title = title;
            this.Page.MetaKeywords = meta;
            this.Page.MetaDescription = des;
        }

        protected void Page_Init(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //SetTitle();

                M.Common.CheckWWW();
                if (Request.UrlReferrer != null) litPreviousPage.Text = Request.UrlReferrer.AbsoluteUri;
            }
            M.Common.CheckLogin();
        }

        protected void Page_PreRender(object sender, EventArgs e)
        {
            M.Common.CheckLogin();
        }


    }
}